{% extends "zinnia/base.html" %}
{% load i18n zinnia_tags mptt_tags disqus_tags %}

{% block title %}{% trans "Sitemap" %}{% endblock %}

{% block content %}
<div id="sitemap">
<h2>{% trans "Sitemap" %}</h2>

<div class="entriesbycategories">
  <h3>{% trans "Entries per categories" %}</h3>
  {% for category in categories %}
  <h4>{{ category }}</h4>
  <ul>
    {% for entry in category.entries_published.all %}
    <li>
      <a href="{{ entry.get_absolute_url }}" title="{{ entry.title }}" rel="bookmark">{{ entry.title }}</a>
      <a class="comment-count" title="Comment at {{ entry.title }}" href="{{ entry.get_absolute_url }}#disqus_thread"></a>
    </li>
    {% empty %}
    <li>
      {% trans "No entries yet." %}
    </li>
    {% endfor %}
  </ul>
  {% endfor %}
</div>

<div class="allentries">
  <h3>{% trans "All the entries" %}</h3>
  <ul>
    {% for entry in entries %}
    <li>
      <a href="{{ entry.get_absolute_url }}" title="{{ entry.title }}" rel="bookmark">{{ entry.title }}</a>
      - {{ entry.creation_date|date:"SHORT_DATE_FORMAT" }}
      <a class="comment-count" title="Comment at {{ entry.title }}" href="{{ entry.get_absolute_url }}#disqus_thread"></a>
    </li>
    {% empty %}
    <li>
      {% trans "No entries yet." %}
    </li>
    {% endfor %}
  </ul>
</div>

<div class="categories">
  <h3>{% trans "Categories" %}</h3>
  {% for category, structure in categories|tree_info %}
    {% if structure.new_level %}<ul><li>{% else %}</li><li>{% endif %}
      <a href="{{ category.get_absolute_url }}" title="{{ category.title }}">{{ category.title }}</a>
      -
      {% blocktrans count category.entries_published.count as entry_count %}{{ entry_count }} entry{% plural %}{{ entry_count }} entries{% endblocktrans %}
    {% for level in structure.closed_levels %}</li></ul>{% endfor %}
    {% empty %}
  <ul>
    <li>
      {% trans "No categories yet." %}
    </li>
  </ul>
  {% endfor %}
</div>

<div class="montharchives">
  <h3>{% trans "Monthly archives" %}</h3>
  {% get_archives_entries %}
</div>
{% disqus_count %}
</div>
{% endblock %}
